#include "labeltitile.h"

#include <QLabel>
#include <QTextLine>
#include <QHBoxLayout>
#include <QLineEdit>
LabelTitile::LabelTitile(QWidget *parent) : QWidget(parent)
{

}

void LabelTitile::setLabelName(const QString& labelName)
{
    this->labelName = labelName;
}

void LabelTitile::showLabelName()
{
    label = new QLabel(this);
    label->setText(this->labelName);
    // 设置字体，大小为20，粗体
     QFont font("Arial",20, QFont::Bold);
     label->setFont(font);

     // 设置文本颜色
     QPalette palette = label->palette();
     palette.setColor(QPalette::WindowText, Qt::darkBlue);
     label->setPalette(palette);
     label->setAutoFillBackground(true);

    layout = new QHBoxLayout(this);
    layout->addStretch();
    layout->addWidget(label);
    layout->addStretch();

    setLayout(layout);
}
